namespace NodeCanvas.Actions
{
	[Category("✫ Utility")]
	[Description("Start, Resume, Pause, Stop a GraphOwner's behaviour")]
	[AgentType(typeof(GraphOwner))]
	public class GraphOwnerControl : ActionTask
	{
		public enum Control
		{
			StartBehaviour = 0,
			StopBehaviour = 1,
			PauseBehaviour = 2
		}

		public Control control;

		protected override string info
		{
			get
			{
				return base.agentInfo + "." + control;
			}
		}

		protected override void OnUpdate()
		{
			if (control == Control.StartBehaviour)
			{
				(base.agent as GraphOwner).StartBehaviour();
			}
			else if (control == Control.StopBehaviour)
			{
				(base.agent as GraphOwner).StopBehaviour();
			}
			else if (control == Control.PauseBehaviour)
			{
				(base.agent as GraphOwner).PauseBehaviour();
			}
			EndAction();
		}
	}
}
